<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <title>PropertyIQ -- Property Search</title>
    
    <style type="text/css">
        #searchContainer
        {
        	margin-left: auto;
        	margin-right: auto;
        	width: 60%;
            margin-top: 20px;
            text-align: left;
            padding: 5px;
        }
        
        .searchTextbox
        {
        	font-size: 13pt;
        	font-family: Calibri, Verdana;
        	color: #828282;
        	background-color: #e6e6e6;
        	border: solid 1px #c0bcbc;
        	width: 99%;
        	padding: 3px; 
        }
        
        #resultsContainer
        {
        	margin-left:auto;
        	margin-right:auto;
        	width: 95%;
        	text-align:center;
        }
    </style>
</asp:Content>

<asp:Content ContentPlaceHolderID="ContentPlaceHolderSidebar" runat="server">

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div id="searchContainer">
        <h2>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            Property Search:</h2>
        <asp:TextBox ID="txtSearchCriteria" runat="server" CssClass="searchTextbox"></asp:TextBox>
        <div class="buttonContainer"><asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="Search" />
        
        </div>
        <asp:UpdateProgress ID="updateProgress" runat="server" DisplayAfter="0" DynamicLayout="false">
            <ProgressTemplate>
                <div style="margin-left:auto;margin-right:auto;text-align:center;">
                    <img src="images/loading.gif" /><span style="font-weight:bold;font-size:12pt;color:#538095;">Loading...</span>
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>
    </div>
            <div id="resultsContainer">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
                </Triggers>
                <ContentTemplate>
                    <asp:Label ID="lblNoResults" runat="server" Text="No Properties found.  Try searching by number and street name only (e.g. 8100 High instead of 8100 High Street)" Visible="false"></asp:Label>
                    <asp:GridView ID="gvSearchResults" runat="server" AutoGenerateColumns="False" 
                CellPadding="1" ForeColor="#333333" GridLines="None" DataKeyNames="property_id" 
                PageSize="6" AllowPaging="true" AllowSorting="true" Width="100%"
                onselectedindexchanged="gvSearchResults_SelectedIndexChanged"
                onpageindexchanging="gvSearchResults_PageIndexChanging">
                        <RowStyle BackColor="#F7F6F3" ForeColor="#2f2f2f" />
                        <FooterStyle BackColor="#2f2f2f" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2f2f2f" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#2f2f2f" Font-Bold="True" ForeColor="White" />
                        <AlternatingRowStyle BackColor="White" ForeColor="#2f2f2f" />
                        <Columns>
                            <asp:CommandField ButtonType="Link" ShowSelectButton="true" 
                    SelectText="View Details" ControlStyle-Font-Size="Smaller" />
                            <asp:TemplateField HeaderText="Image">
                                <ItemTemplate>
                                    <img src="images/house_pic.jpg" style="width: 60px;" />
                                </ItemTemplate>
                            </asp:TemplateField> 
                            <asp:BoundField HeaderText="Address" DataField="street_address" />


                            <asp:BoundField HeaderText="Square Footage" DataField="sq_footage" />
                            <asp:BoundField HeaderText="# Bedrooms" DataField="bedrooms" />
                            <asp:BoundField HeaderText="Taxable Value" DataField="taxable_total_val" />
                        </Columns>
                    </asp:GridView>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
</asp:Content>

